Skip to content

feat(confidentialrelay): vendor SignedComputeRequest + relay response bundle (PRIV-433)#2109

Merged
prashantkumar1982 merged 11 commits into
mainfrom
tejaswi/vendor-signed-compute-request
Jun 11, 2026
Merged

feat(confidentialrelay): vendor SignedComputeRequest + relay response bundle (PRIV-433)#2109
prashantkumar1982 merged 11 commits into
mainfrom
tejaswi/vendor-signed-compute-request

Conversation

@nadahalli

@nadahalli nadahalli commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Two additive changes to the confidentialrelay types, both backward-compatible (no fields removed):

1. Vendor SignedComputeRequest + Hash (original scope)
Vendors ComputeRequest, its canonical Hash, and SignedComputeRequest from confidential-compute so the relay DON can reconstruct the workflow-DON request hash and verify F+1 signatures over it. chainlink-common cannot import confidential-compute, so the byte-for-byte conformance check lives in that repo.

2. Relay response bundle types (gateway liveness fix)
Adds SignedSecretsResponseBundle and SignedCapabilityResponseBundle, the gateway→enclave envelope that carries every relay node's signed response. This supports moving signature verification entirely into the enclave: the gateway becomes a dumb fan-in that forwards all collected responses without merging, trusting, or counting signatures, and the enclave verifies each against the relay-DON signer set and accepts the result backed by F+1 valid distinct signers. Closes a liveness gap where the gateway counted unverified, attacker-supplied signer identities toward quorum.

Also adds a single Signature field to the per-node signed-result types (a node signs only its own response) and marks the Signatures array Deprecated, kept and still populated for backward compatibility until chainlink and confidential-compute migrate.

Downstream (chainlink gateway + relay node, confidential-compute enclave) adopt these in follow-up PRs after this lands.

The relay DON (chainlink/core) cannot import confidential-compute (the dependency runs
the other way), so vendor ComputeRequest/SignedComputeRequest and the canonical
ComputeRequest.Hash into the confidentialrelay package. This lets the relay verify the
Workflow DON's F+1 signatures over a forwarded compute request directly, the basis for
replacing the separate WorkflowAuthz blob.

Hash reuses this package's existing length-prefix helpers (byte-identical to the source's
writeWithLength/writeLengthPrefix), so no duplicate helpers. Tests cover determinism,
field-binding, and the intentional exclusion of EncryptedDecryptionKeyShares. Byte-for-byte
conformance with the source Hash will be enforced by a test in confidential-compute (which
can import this package); common cannot import CC.
Copilot AI review requested due to automatic review settings June 1, 2026 15:09
@nadahalli nadahalli requested a review from a team as a code owner June 1, 2026 15:09
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

👋 nadahalli, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

✅ API Diff Results - github.com/smartcontractkit/chainlink-common

✅ Compatible Changes (8)

pkg/capabilities/v2/actions/confidentialrelay (5)
  • ComputeRequest — ➕ Added

  • SignedCapabilityResponseBundle — ➕ Added

  • SignedComputeRequest — ➕ Added

  • SignedComputeRequestSignaturePayload — ➕ Added

  • SignedSecretsResponseBundle — ➕ Added

pkg/capabilities/v2/actions/confidentialrelay.SecretsRequestParams (1)
  • SignedComputeRequests — ➕ Added
pkg/capabilities/v2/actions/confidentialrelay.SignedCapabilityResponseResult (1)
  • Signature — ➕ Added
pkg/capabilities/v2/actions/confidentialrelay.SignedSecretsResponseResult (1)
  • Signature — ➕ Added

📄 View full apidiff report

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR vendors the minimal ComputeRequest/SignedComputeRequest types and canonical ComputeRequest.Hash() logic into pkg/capabilities/v2/actions/confidentialrelay so the relay DON can verify the workflow DON’s existing F+1-signed compute request (without introducing a separate WorkflowAuthz blob and without adding a dependency from chainlink-common to confidential-compute).

Changes:

  • Added vendored ComputeRequest + SignedComputeRequest types and ComputeRequest.Hash() implementation (intended to be byte-identical to confidential-compute).
  • Added self-contained tests covering hash determinism, field binding, and intentional exclusion of EncryptedDecryptionKeyShares.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/capabilities/v2/actions/confidentialrelay/computerequest.go Introduces vendored compute-request structs plus canonical hashing logic and domain separator.
pkg/capabilities/v2/actions/confidentialrelay/computerequest_test.go Adds tests to lock in hashing behavior (determinism, field binding, excluded fields).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +23 to +27
RequestID [32]byte `json:"requestID"`
PublicData []byte `json:"publicData"`
Ciphertexts [][]byte `json:"ciphertexts"`
CiphertextNames []string `json:"CiphertextNames"`
EncryptedDecryptionKeyShares [][][]byte `json:"encryptedDecryptionKeyShares"`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional. This type is vendored verbatim from confidential-compute types.ComputeRequest, where the tag is json:"CiphertextNames" (capital C). The relay must marshal and unmarshal exactly what the enclave emits, so the tag has to match the source byte for byte. The capital C is a quirk in the source, but matching it is what preserves wire compatibility; changing it here is what would break it. Leaving as-is.

nadahalli added 3 commits June 1, 2026 17:12
…tParams

Add SignedComputeRequests []SignedComputeRequest to SecretsRequestParams: the F+1
Workflow-DON-signed compute requests the enclave forwards for the relay DON to verify.
Excluded from the response hash, matching Attestation/EnclaveConfig.
…elper

The relay DON verifies the F+1 Workflow DON signatures over a forwarded SignedComputeRequest
by reconstructing the peerid domain-separated payload the nodes signed. Adds
SignedComputeRequestSignaturePayload + the vendored prefix CONFIDENTIAL_COMPUTE_PAYLOAD_
(from CC util.GetConfidentialComputePayloadPrefix). The relay cannot import
confidential-compute, so this lives here.
vreff
vreff previously approved these changes Jun 2, 2026
…-compute-request

# Conflicts:
#	pkg/capabilities/v2/actions/confidentialrelay/types.go
@nadahalli nadahalli requested a review from a team as a code owner June 10, 2026 10:53
vreff
vreff previously approved these changes Jun 10, 2026
Add SignedSecretsResponseBundle and SignedCapabilityResponseBundle, the
gateway->enclave envelope for forwarding every relay node's signed
response without the gateway merging, trusting, or deciding quorum over
them. The enclave groups by response hash, verifies each signature
against the relay-DON signer set, and accepts the result backed by F+1
valid distinct signers.

Add a single Signature field to the per-node signed-result types (a node
signs only its own response) and deprecate the Signatures array. The
array is kept and still populated for backward compatibility until
chainlink and confidential-compute migrate to Signature.
@nadahalli nadahalli changed the title feat(confidentialrelay): vendor SignedComputeRequest + Hash (PRIV-433) feat(confidentialrelay): vendor SignedComputeRequest + relay response bundle (PRIV-433) Jun 11, 2026
@prashantkumar1982 prashantkumar1982 added this pull request to the merge queue Jun 11, 2026
Merged via the queue into main with commit 87b1e75 Jun 11, 2026
31 of 33 checks passed
@prashantkumar1982 prashantkumar1982 deleted the tejaswi/vendor-signed-compute-request branch June 11, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants